#include <iostream>
#include <map>
using namespace std;
int main()
{
    string str1, str2;
    map<char, int> m1, m2;
    cin >> str1 >> str2;
    for (int i = 0; i < str1.length(); i++)
        m1[str1[i]]++;
    for (int i = 0; i < str2.length(); i++)
        m2[str2[i]]++;
    bool flag = true;
    map<char, int>::iterator it;
    int count = 0;
    for (it = m2.begin(); it != m2.end(); it++)
    {
        while (it->second--)
        {
            if (m1[it->first] == 0)
            {
                flag = false;
                count++;
            }
            else
            {
                m1[it->first]--;
            }
        }
    }
    if (flag)
    {
        cout << "Yes " << str1.length() - str2.length();
    }
    else
    {
        cout << "No " << count;
    }

    return 0;
}